#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

set debug_mode="(DEBUG mode)"
set kdir=/android
set name="Android-x86"

# $1 Title
# $2... Kernel cmdline
function add_entry {
	menuentry "$name $1" "$@" --class android-x86 {
		shift 2
		set root=$android
		# For PrimeOS 0.6.1
		linux $kdir/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug $src $@
		initrd $kdir/initrd.img
	}
}

if [ -s $prefix/grubenv ]; then
	load_env
fi

set bootefi=BOOTx64.EFI
set grub=grubx64

if [ -z "$src" -a -n "$isofile" ]; then
	set src=iso-scan/filename=$isofile
fi

search --no-floppy --set android -f $kdir/kernel
export android bootefi grub kdir live src

# Create main menu
add_entry "$live" quiet

submenu "$name Advanced options -> " {
	add_entry "$debug_mode - DEBUG Mode" DEBUG=2
	add_entry "$live - No Setup Wizard" quiet SETUPWIZARD=0
	add_entry "$live - No Hardware Acceleration" quiet nomodeset HWACCEL=0
}
